﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="manage4systemsFornecedoresList.List" %>

<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<%@ Register src="~/DynamicData/Content/FilterUserControl.ascx" tagname="DynamicFilter" tagprefix="asp" %>

<%@ Register assembly="Catalyst.Web.DynamicData" namespace="Catalyst.Web.DynamicData" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
    
    <div class="tamanho">

    <h2>Lista de Fornecedores</h2>

    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                HeaderText="Lista de erros de validação" />
            <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" />


            <asp:DynamicFilterForm ID="DynamicFilterForm1" runat="server" DataSourceID="GridDataSource">
            <FilterTemplate> Razão social
            <asp:DynamicFilterControl ID="DynamicFilterControl3" runat="server" DataField="razaoSocialFornecedor"
                FilterMode="Contains" /> 
               
                <asp:Button ID="LinkButton1" runat="server" CommandName="Search" Text="Procurar"></asp:Button><br />
                
            </FilterTemplate>
            </asp:DynamicFilterForm>
               <br />       
                      

            
            <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource"
                AllowPaging="True" AllowSorting="True" CssClass="gridview" 
                AutoGenerateColumns="False" Width="99%">
                <Columns>
                
                    <asp:DynamicField DataField="razaoSocialFornecedor" HeaderText="Razão Social " />
                    <asp:DynamicField DataField="cnpjFornecedor" HeaderText="Cnpj " />
                    <asp:DynamicField DataField="pessoaContato1Fornecedor" HeaderText="Funcionário de contato 1 " />
                    <asp:DynamicField DataField="telefone1Fornecedor" HeaderText="Telefone 1" />
<%--                    <asp:DynamicField DataField="pessoaContato2Fornecedor" HeaderText="Funcionário de contato 2  " />
                    <asp:DynamicField DataField="telefone2Fornecedor" HeaderText="Telefone 2 " />--%>
<%--                    <asp:DynamicField DataField="pessoaContato3Fornecedor" HeaderText="Funcionário de contato 3 " />
                    <asp:DynamicField DataField="telefone3Fornecedor" HeaderText="Telefone 3 " />--%>
                    <asp:DynamicField DataField="emailFornecedor" HeaderText="Email " />
<%--                    <asp:DynamicField DataField="enderecoFornecedor" HeaderText="Endereço " />
                    <asp:DynamicField DataField="estadoFornecedor" HeaderText="Estado " />
                    <asp:DynamicField DataField="cidadeFornecedor" HeaderText="Cidade " />
                    <asp:DynamicField DataField="observacaoFornecedor" HeaderText="Observações " />--%>


                    <asp:TemplateField HeaderText="Ações">
                        
                        <ItemTemplate>
                        
                            <asp:HyperLink ID="EditHyperLink" runat="server" title="Editar" title="Editar informações do Fornecedor"
                                NavigateUrl='<%# table.GetActionPath(PageAction.Edit, GetDataItem()) %>'
                             ImageUrl="~/images/btEditar.gif"/>&nbsp;                            
                            
                            <asp:HyperLink ID="DetailsHyperLink" runat="server" title="Visualizar todas informações" title="Ver todas as informações do Fornecedor"
                                NavigateUrl='<%# table.GetActionPath(PageAction.Details, GetDataItem()) %>'
                                ImageUrl="~/images/btVer.gif" />
                                
<%--                            <a href="#" onclick="javascript:window.open('../../areasAtuacao.aspx?codigoEdital=<%#Eval("codigoEdital") %>','Áreas de atuação','location=0,resizable=0,status=0,scrollbars=0,width=450,height=500');"><img src="../../../images/btVerPais.gif" title="Definir áreas de atuação do Edital"></a>
               
                            <a href="#" onclick="javascript:window.open('../../adiarEdital.aspx?codigoEdital=<%#Eval("codigoEdital") %>','Adiar Edital','location=0,resizable=0,status=0,scrollbars=0,width=450,height=200');"><img src="../../../images/btAdiarEdital.gif" title="Adiar Edital"></a>
                            
                            <a href="#" onclick="javascript:window.open('../../cancelarEdital.aspx?codigoEdital=<%#Eval("codigoEdital") %>','Cancelar Edital','location=0,resizable=0,status=0,scrollbars=0,width=450,height=200');"><img src="../../../images/btExcluir.gif" title="Cancelar Edital"></a>
                                
                            <a href="#" onclick="javascript:window.open('../../iniciarProposta.aspx?codigoEdital=<%#Eval("codigoEdital") %>','Iniciar proposta','location=0,resizable=0,status=0,scrollbars=0,width=450,height=200');"><img src="../../../images/cancelarPagamento.gif" title="Iniciar proposta"></a>
--%>                                    
                                
                            <asp:LinkButton ID="DeleteLinkButton" runat="server" CommandName="Delete"
                                CausesValidation="false" Text="Excluir" title="Excluir"
                                OnClientClick='return confirm("Tem certeza que deseja excluir o fornecedor?");'
                            />&nbsp;      
                            
                        </ItemTemplate>
                        
                    </asp:TemplateField>

                </Columns>

                <PagerStyle CssClass="footer"/>        
                <PagerTemplate>
                    <asp:GridViewPager ID="GridViewPager1" runat="server" />
                </PagerTemplate>
                <EmptyDataTemplate>
                    Não existem fornecedores cadastrados no sistema.
                </EmptyDataTemplate>
            </asp:GridView>

             <asp:DynamicLinqDataSource ID="GridDataSource" runat="server" ContextTypeName="sistemaAcademicoFinanceiroEscolas.modeloDataContext"
             TableName="fornecedors" EnableDelete="True">
            </asp:DynamicLinqDataSource>
            
            <br />

            <div class="bottomhyperlink">
                <asp:HyperLink ID="InsertHyperLink" runat="server"><img runat="server" src="~/DynamicData/Content/Images/plus.gif" alt="Cadastrar novo fornecedor" />&nbsp;Cadastrar novo fornecedor</asp:HyperLink>
            </div>
            
            <br>
            
            
        </ContentTemplate>
    </asp:UpdatePanel>
    
    </div>
    
</asp:Content>
